Skip to content

Asymmetric consumer element type in ObjectFifo#3117

Open
yenjames wants to merge 2 commits into
mainfrom
asymmetric-consumer-type
Open

Asymmetric consumer element type in ObjectFifo#3117
yenjames wants to merge 2 commits into
mainfrom
asymmetric-consumer-type

Conversation

@yenjames
Copy link
Copy Markdown
Collaborator

Summary

This PR is a proposal to introduce an optional consumerElemType for asymmetric transfers in ObjectFifos.

  • Producer sends elemType-sized transfers, consumer receives consumerElemType-sized transfers. Producer element count must be an integer multiple of consumer element count.

Example

Input — a single ObjectFifo with 40xi32 producer type and 10xi32 consumer type:

aie.objectfifo @wts(%mt, {%ct}, 1 : i32) : !aie.objectfifo<memref<40xi32>>  -> !aie.objectfifo<memref<10xi32>>
= [dense<0> : memref<40xi32>]                                                                                                                                            

After --aie-objectFifo-stateful-transform, the producer and consumer get independently-sized buffers and BD lengths:

// MemTile: 40xi32 buffer with static init, BD sends 40 elements
%wts_buff_0 = aie.buffer(%mem_tile) {sym_name = "wts_buff_0"} : memref<40xi32> = dense<0>
aie.dma_bd(%wts_buff_0 : memref<40xi32>, 0, 40) 

// CoreTile: 10xi32 buffer, BD receives 10 elements                                                                                                                                          
%wts_cons_buff_0 = aie.buffer(%core_tile) {sym_name = "wts_cons_buff_0"} : memref<10xi32>
aie.dma_bd(%wts_cons_buff_0 : memref<10xi32>, 0, 10)                                                                                                                                         

The MemTile DMA sends 40 elements, and the CoreTile DMA receives them 10 at a time across 4 acquire/release cycles.

Changes

  • AIEOps.td: Optional consumerElemType attribute, -> assembly format, getConsumerElemTypeOrDefault() helper
  • AIEDialect.cpp: Verifier (integer multiple check), parser/printer for -> <type> syntax, AcquireOp verifier accepts consumer type
  • AIEObjectFifoStatefulTransform.cpp: requiresDMAs() returns true for asymmetric types, split fifo uses consumer type for consumer buffer
  • python/dialects/aie.py: consumer_datatype parameter, acquire() returns consumer type for Consume port
  • python/iron/dataflow/objectfifo.py: consumer_obj_type parameter plumbed through to low-level bindings
  • Tests: verifier error test, two stateful transform tests (basic + initValues), IRON Python test

ObjectFifo now supports an optional consumer element type for
asymmetric transfer granularity. The producer sends elemType-sized
transfers and the consumer receives consumerElemType-sized transfers.
The DMA hardware handles the size mismatch via AXI backpressure.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Coverage Report

Created: 2026-05-27 17:45

Click here for information about interpreting this report.

FilenameFunction CoverageLine CoverageRegion CoverageBranch Coverage
IR/AIEDialect.cpp 90.85% 86.56% 87.80% 79.87%
Transforms/AIEObjectFifoStatefulTransform.cpp 100.00% 94.86% 92.83% 86.21%
Totals 93.07% 90.45% 89.66% 82.42%
Generated by llvm-cov -- llvm version 18.1.3

@yenjames yenjames marked this pull request as ready for review May 26, 2026 21:02
Copilot AI review requested due to automatic review settings May 26, 2026 21:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR proposes adding an optional consumer element type to aie.objectfifo to support asymmetric transfer granularity, where the producer and consumer sides use different element sizes while remaining compatible (producer size is an integer multiple of consumer size). This spans IR syntax/parsing/verification, the stateful ObjectFifo transform, Python bindings, and new tests.

Changes:

  • Extend aie.objectfifo with an optional consumerElemType and -> <type> assembly syntax, plus verifier support for producer/consumer size ratio.
  • Update aie.objectfifo.acquire verification and the stateful transform to respect the consumer-side element type (buffer type + DMA BD lengths).
  • Plumb the feature through Python (dialect + IRON) and add MLIR + Python regression tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
include/aie/Dialect/AIE/IR/AIEOps.td Adds optional consumerElemType, custom -> assembly hook, and helper accessor.
lib/Dialect/AIE/IR/AIEDialect.cpp Adds verifier for asymmetric sizing, parser/printer for ->, and relaxes acquire verifier to accept consumer type.
lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp Forces DMA path for asymmetric FIFOs and uses consumer type for consumer-side split FIFO/buffer.
python/dialects/aie.py Adds consumer_datatype plumbing and makes consumer-side acquire() return the consumer element type when provided.
python/iron/dataflow/objectfifo.py Adds IRON-level consumer_obj_type and passes it to the dialect op builder.
test/dialect/AIE/objectfifo_bad.mlir Adds a verifier-negative test for non-integer-multiple sizing and fixes formatting in an existing case.
test/objectFifo-stateful-transform/asymmetric_element_type/asymmetric_element_type.mlir New stateful-transform test validating producer/consumer buffer and BD lengths with asymmetric types.
test/objectFifo-stateful-transform/asymmetric_element_type/asymmetric_with_initvalues.mlir New stateful-transform test covering asymmetric types with initValues and depth>1.
test/python/objFifo_asymmetric.py New Python test validating IRON plumbing and printed IR contains the -> consumer type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Dialect/AIE/IR/AIEDialect.cpp
Comment thread lib/Dialect/AIE/IR/AIEDialect.cpp
Comment thread lib/Dialect/AIE/IR/AIEDialect.cpp
Comment thread include/aie/Dialect/AIE/IR/AIEOps.td Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants